builderparser: Don't exit too early on nested custom tags
authorAlexander Mikhaylenko <alexm@gnome.org>
Tue, 28 Feb 2023 10:25:42 +0000 (14:25 +0400)
committerAlexander Mikhaylenko <alexm@gnome.org>
Tue, 28 Feb 2023 10:46:14 +0000 (14:46 +0400)
commit2bcc3cfb33cdfa73c4f583a2df782db04db4e0e3
treef1c3947105a001b95859ef7fc8b5eaa93f8c58dc
parentdbaaa59758303aad1bfeaddcbe3e86baf8b4b0ba
builderparser: Don't exit too early on nested custom tags

Currently nested custom tags work only as long as the element names differ
from the root one. If it's same, for example:

<condition type="any">
  <condition type="max-width">600</condition>
  <condition type="max-height">600</condition>
</condition>

then it will fail. Meanwhile the same tags wrapped into <conditions> would
work.

The problem is that custom tag parsing is considered finished as soon as we
encounter a closing tag with the same element name. So instead, track the
nesting level.
gtk/gtkbuilderparser.c
gtk/gtkbuilderprivate.h